home *** CD-ROM | disk | FTP | other *** search
/ Aminet 48 / Aminet 48 (2002)(GTI - Schatztruhe)[!][Apr 2002].iso / Aminet / dev / src / expat-src.lha / expat-1.95.2 / include / expat / expat.h next >
Encoding:
C/C++ Source or Header  |  2001-10-25  |  7.1 KB  |  221 lines

  1. /*
  2. **      $VER: expat.h 1.0 (1/8/01)
  3. **
  4. **      main include file for expat.library
  5. **
  6. */
  7.  
  8. #ifndef EXPAT_EXPAT_H
  9. #define EXPAT_EXPAT_H
  10.  
  11.  
  12. #ifndef XMLPARSEAPI
  13. #  if defined(__declspec) && !defined(__BEOS__)
  14. #    define XMLPARSEAPI(type) __declspec(dllimport) type __cdecl
  15. #  else
  16. #    define XMLPARSEAPI(type) type
  17. #  endif
  18. #endif  /* not defined XMLPARSEAPI */
  19.  
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.   
  25. typedef void *XML_Parser;
  26.  
  27. /* Information is UTF-8 encoded. */
  28. typedef char XML_Char;
  29. typedef char XML_LChar;
  30.  
  31. enum XML_Content_Type {
  32.   XML_CTYPE_EMPTY = 1,
  33.   XML_CTYPE_ANY,
  34.   XML_CTYPE_MIXED,
  35.   XML_CTYPE_NAME,
  36.   XML_CTYPE_CHOICE,
  37.   XML_CTYPE_SEQ
  38. };
  39.  
  40. enum XML_Content_Quant {
  41.   XML_CQUANT_NONE,
  42.   XML_CQUANT_OPT,
  43.   XML_CQUANT_REP,
  44.   XML_CQUANT_PLUS
  45. };
  46.  
  47. typedef struct XML_cp XML_Content;
  48.  
  49. struct XML_cp {
  50.   enum XML_Content_Type        type;
  51.   enum XML_Content_Quant    quant;
  52.   XML_Char *            name;
  53.   unsigned int            numchildren;
  54.   XML_Content *            children;
  55. };
  56.  
  57. typedef void (*XML_ElementDeclHandler) (void *userData,
  58.                                         const XML_Char *name,
  59.                                         XML_Content *model);
  60.  
  61. typedef void (*XML_AttlistDeclHandler) (void           *userData,
  62.                                         const XML_Char *elname,
  63.                                         const XML_Char *attname,
  64.                                         const XML_Char *att_type,
  65.                                         const XML_Char *dflt,
  66.                                         int        isrequired);
  67. typedef void (*XML_XmlDeclHandler) (void        *userData,
  68.                                     const XML_Char    *version,
  69.                                     const XML_Char    *encoding,
  70.                                     int              standalone);
  71.  
  72.  
  73. typedef struct {
  74.   void *(*malloc_fcn)(size_t size);
  75.   void *(*realloc_fcn)(void *ptr, size_t size);
  76.   void (*free_fcn)(void *ptr);
  77. } XML_Memory_Handling_Suite;
  78.  
  79.  
  80. typedef void (*XML_StartElementHandler)(void *userData,
  81.                                         const XML_Char *name,
  82.                                         const XML_Char **atts);
  83.  
  84. typedef void (*XML_EndElementHandler)(void *userData,
  85.                                       const XML_Char *name);
  86.  
  87. /* s is not 0 terminated. */
  88. typedef void (*XML_CharacterDataHandler)(void *userData,
  89.                                          const XML_Char *s,
  90.                                          int len);
  91.  
  92. /* target and data are 0 terminated */
  93. typedef void (*XML_ProcessingInstructionHandler)(void *userData,
  94.                                                  const XML_Char *target,
  95.                                                  const XML_Char *data);
  96.  
  97. /* data is 0 terminated */
  98. typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data);
  99.  
  100. typedef void (*XML_StartCdataSectionHandler)(void *userData);
  101. typedef void (*XML_EndCdataSectionHandler)(void *userData);
  102.  
  103. typedef void (*XML_DefaultHandler)(void *userData,
  104.                                    const XML_Char *s,
  105.                                    int len);
  106.  
  107. /* This is called for the start of the DOCTYPE declaration, before
  108.    any DTD or internal subset is parsed. */
  109.  
  110. typedef void (*XML_StartDoctypeDeclHandler)(void *userData,
  111.                                             const XML_Char *doctypeName,
  112.                                             const XML_Char *sysid,
  113.                                             const XML_Char *pubid,
  114.                                             int has_internal_subset);
  115.  
  116. typedef void (*XML_EndDoctypeDeclHandler)(void *userData);
  117.  
  118. typedef void (*XML_EntityDeclHandler) (void *userData,
  119.                                        const XML_Char *entityName,
  120.                                        int is_parameter_entity,
  121.                                        const XML_Char *value,
  122.                                        int value_length,
  123.                                        const XML_Char *base,
  124.                                        const XML_Char *systemId,
  125.                                        const XML_Char *publicId,
  126.                                        const XML_Char *notationName);
  127.  
  128. typedef void (*XML_UnparsedEntityDeclHandler)(void *userData,
  129.                                               const XML_Char *entityName,
  130.                                               const XML_Char *base,
  131.                                               const XML_Char *systemId,
  132.                                               const XML_Char *publicId,
  133.                                               const XML_Char *notationName);
  134.  
  135. typedef void (*XML_NotationDeclHandler)(void *userData,
  136.                                         const XML_Char *notationName,
  137.                                         const XML_Char *base,
  138.                                         const XML_Char *systemId,
  139.                                         const XML_Char *publicId);
  140.  
  141. typedef void (*XML_StartNamespaceDeclHandler)(void *userData,
  142.                                               const XML_Char *prefix,
  143.                                               const XML_Char *uri);
  144.  
  145. typedef void (*XML_EndNamespaceDeclHandler)(void *userData,
  146.                                             const XML_Char *prefix);
  147.  
  148. typedef int (*XML_NotStandaloneHandler)(void *userData);
  149.  
  150. typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser,
  151.                                             const XML_Char *context,
  152.                                             const XML_Char *base,
  153.                                             const XML_Char *systemId,
  154.                                             const XML_Char *publicId);
  155.  
  156. typedef struct {
  157.   int map[256];
  158.   void *data;
  159.   int (*convert)(void *data, const char *s);
  160.   void (*release)(void *data);
  161. } XML_Encoding;
  162.  
  163. typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData,
  164.                                           const XML_Char *name,
  165.                                           XML_Encoding *info);
  166.  
  167. enum XML_ParamEntityParsing {
  168.   XML_PARAM_ENTITY_PARSING_NEVER,
  169.   XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE,
  170.   XML_PARAM_ENTITY_PARSING_ALWAYS
  171. };
  172.  
  173. enum XML_Error {
  174.   XML_ERROR_NONE,
  175.   XML_ERROR_NO_MEMORY,
  176.   XML_ERROR_SYNTAX,
  177.   XML_ERROR_NO_ELEMENTS,
  178.   XML_ERROR_INVALID_TOKEN,
  179.   XML_ERROR_UNCLOSED_TOKEN,
  180.   XML_ERROR_PARTIAL_CHAR,
  181.   XML_ERROR_TAG_MISMATCH,
  182.   XML_ERROR_DUPLICATE_ATTRIBUTE,
  183.   XML_ERROR_JUNK_AFTER_DOC_ELEMENT,
  184.   XML_ERROR_PARAM_ENTITY_REF,
  185.   XML_ERROR_UNDEFINED_ENTITY,
  186.   XML_ERROR_RECURSIVE_ENTITY_REF,
  187.   XML_ERROR_ASYNC_ENTITY,
  188.   XML_ERROR_BAD_CHAR_REF,
  189.   XML_ERROR_BINARY_ENTITY_REF,
  190.   XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF,
  191.   XML_ERROR_MISPLACED_XML_PI,
  192.   XML_ERROR_UNKNOWN_ENCODING,
  193.   XML_ERROR_INCORRECT_ENCODING,
  194.   XML_ERROR_UNCLOSED_CDATA_SECTION,
  195.   XML_ERROR_EXTERNAL_ENTITY_HANDLING,
  196.   XML_ERROR_NOT_STANDALONE,
  197.   XML_ERROR_UNEXPECTED_STATE
  198. };
  199.  
  200. #define XML_GetErrorLineNumber XML_GetCurrentLineNumber
  201. #define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
  202. #define XML_GetErrorByteIndex XML_GetCurrentByteIndex
  203.  
  204. typedef struct {
  205.   int major;
  206.   int minor;
  207.   int micro;
  208. } XML_Expat_Version;
  209.  
  210. #define XML_MAJOR_VERSION 1
  211. #define XML_MINOR_VERSION 95
  212. #define XML_MICRO_VERSION 2
  213.  
  214. #define XML_GetUserData(parser) (*(void **)(parser))
  215.  
  216. #ifdef __cplusplus
  217. }
  218. #endif
  219.  
  220. #endif /* EXPAT_EXPAT_H */
  221.